﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="EditTrack.aspx.cs" Inherits="MusicSite.Views.Content.Track.EditTrack" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create/Edit track
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="../../../Content/scripts/SiteScripts.js"></script>
<form id="form1" runat="server">
<h2>Create/Edit track</h2>
    
    <fieldset>
        <legend>Fields</legend>
        <table class="regform">
            <tr>
                <td>
                    <asp:Label ID="label1" runat="server" AssociatedControlID="trackName" Text="Name:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="trackName" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorName" runat="server"
                        ControlToValidate="trackName" ErrorMessage="You must provide an track name!"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label2" runat="server" AssociatedControlID="rating" Text="Rating:"></asp:Label>
                </td>
                <td>
                    <asp:HiddenField ID="rating" runat="server"/>
                    <ul class="star-rating">
                        <li onclick="starRating(1, this)">
                            <asp:HyperLink ID="hyperlink1" runat="server" CssClass="one-star">1</asp:HyperLink>
                        </li>
                        <li onclick="starRating(2, this)">
                            <asp:HyperLink ID="hyperlink2" runat="server" CssClass="two-stars">2</asp:HyperLink>
                        </li>
                        <li onclick="starRating(3, this)">
                            <asp:HyperLink ID="hyperlink3" runat="server" CssClass="three-stars">3</asp:HyperLink>
                        </li>
                        <li onclick="starRating(4, this)">
                            <asp:HyperLink ID="hyperlink4" runat="server" CssClass="four-stars">4</asp:HyperLink>
                        </li>
                        <li onclick="starRating(5, this)">
                            <asp:HyperLink ID="hyperlink5" runat="server" CssClass="five-stars">5</asp:HyperLink>
                        </li>
                    </ul>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label5" runat="server" AssociatedControlID="timeTrack" Text="Track time:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="timeTrack" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ID="validatorDate" ControlToValidate="timeTrack" 
                        ErrorMessage="You must provide a track time!" InitialValue="">
				    </asp:RequiredFieldValidator>
				    <asp:RegularExpressionValidator runat="server" ID="validatorDate2" ControlToValidate="timeTrack"
				        ErrorMessage="Please enter a valid time!" ValidationExpression="\d{1,2}:\d{1,2}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label7" runat="server" AssociatedControlID="album" Text="Album:"></asp:Label>                
                </td>
                <td>
                    <asp:DropDownList ID="album" runat="server"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton ID="btnUpdate" runat="server" Text="Update" 
                        OnCommand="UpdateTrack"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" 
                        OnCommand="DeleteTrack"></asp:LinkButton>
                </td>
            </tr>
        </table> 
               
    </fieldset>
    <div>
        <asp:HyperLink ID="hyperLink" runat="server" Text="Back to list" 
            NavigateUrl="~/Views/Content/Track/IndexTrack.aspx" ></asp:HyperLink>    
           
    </div>
</form>
<script type="text/javascript">
var lists = document.getElementsByTagName('UL');
for(var i in lists)
{
initRating(lists[i]);
}
</script>
</asp:Content>
